import { createStore } from "vuex";
import user from "./modules/user";
export default createStore({
  state: {},
  mutations: {},
  actions: {},
  modules: {
    user,
  },

  getters: {
    // vuex的快捷访问 vuex计算属性
    token: (state) => state.user.token,
    hasUserInfo: (state) => {
      return JSON.stringify(state.user.userInfo) !== "{}";
    },
    userInfo: (state) => state.user.userInfo,
  },
});
